# -*- coding: utf-8 -*-
# @Author	: changfeng
# @Date		: 2025/9/13 13:58
# @Last Modified by:   changfeng
# @Last Modified time: 2025/9/13 13:58
# Thanks for your comments!
import logging
import traceback

from src.basedata.application.commands import SyncBasedata
from src.basedata.domain.service.basedata_sync import BaseDataSync
from src.basedata.infrastructure.common.unit_of_work import AbstractUnitOfWork

logger = logging.getLogger(__name__)


async def sync_basedata_handler(cmd: SyncBasedata,
                                uow: AbstractUnitOfWork):
    data_sync_obj = BaseDataSync(uow)
    await data_sync_obj.sync_basedata_from_his(cmd.app_id, cmd.method_name)
